<template>
   <h2>我是About</h2>
</template>

<script>
export default {
    name: 'stuAbout',
    
     beforeRouteEnter (to, from, next) {
        //通过路由规则进入该组件时调用
        console.log('about----------beforeRouteEnter')
        if(to.meta.isAuth) { //判断是否需要鉴定权限
        if(localStorage.getItem('school') === 'atguigu') {
            next()
        } else {
            alert('学校名不对,无权限查看')
        }
    } else {
        next()
    }
     },
     beforeRouteLeave (to, from, next) {
        //通过路由规则,离开该组件时调用
        console.log('about----------beforeRouteLeave')
        console.log(to, from, next)
        next()
     }
}
</script>

<style>

</style>